package com.training.java.core.multithreading;

public class ThreadDemo {

	public static void main(String[] args)
	{
		//Calling MyFirstThread class which extends Thread
		for(int i=0;i<10;i++)
		{
		  System.out.println("I am in  " + Thread.currentThread().getName() + "i=" + i);
		}
		
		new MyFirstThread().start();
		
		for(int j=0; j<100; j++)
		{
			System.out.println("I am in  " + Thread.currentThread().getName() + "j=" + j);
		}
		
		//==================================================================
		
		//Calling MySecondThread which implements Runnable interface
		
		for(int k=0;k<10;k++)
		{
		  System.out.println("I am in  " + Thread.currentThread().getName() + " k=" + k);
		}
		
		new Thread(new MySecondThread()).start();
		
		for(int m=0;m<100;m++)
		{
		  System.out.println("I am in  " + Thread.currentThread().getName() + " m=" + m);
		}
		
		
	}

}
